<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>首页</title>
<link rel='stylesheet' type='text/css' href='../static/jquery-ui/css/redmond/jquery-ui.min.css' />
<link rel='stylesheet' type='text/css' href='../static/fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='../static/navigate/css/navigate.css' />
<link rel='stylesheet' type='text/css' href='../static/ztree/css/zTreeStyle.css' />
<link rel='stylesheet' type='text/css' href='../static/css/tableStyle.css' />

</head>
<#assign shiro=JspTaglibs["/WEB-INF/taglib/shiro.tld"] />
<body>
<div class="top">
	<div id="site_nav">
	  <ul class="top_menu">
	  	<li class="myhd menu-item">
		  	<div class="menu"> <a class="menu-hd" style="color: #0b72a4;" href="javascript:void(0);" >${(user.name)!}<b></b></a>
		        <div class="mybd">
		          <div class="menu-bd-panel">
		            <a href="#" id="accountmc">帐号管理</a><br/>
		            <a href="/course/logout.do" >退出</a> 
		          </div>
		        </div>
		        
		      </div>
	      </li>
	    <li class="myhd menu-item">
	      <div class="menu"> <a class="menu-hd" href="#" id="showtlist">教师<b></b></a>
	        <div class="mybd">
	          <div class="menu-bd-panel">
	            <@shiro.hasRole name="admin"><a href="#" id="addt">添加教师</a></@shiro.hasRole>
	          </div>
	        </div>
	      </div>
	    </li>
	    <li class="myhd menu-item">
	      <div class="menu"> 
	      	<a class="menu-hd" href="#" id="showclist" <@shiro.hasRole name="teacher">style="display: none;"</@shiro.hasRole>>课程表</a>
	      </div>
	    </li>
	    <li class="myhd menu-item">
	      <div class="menu"> <a class="menu-hd" href="#" id="showplist">授课地点<b></b></a>
	        <div class="mybd">
	          <div class="menu-bd-panel">
	            <@shiro.hasRole name="admin"><a href="#" id="addplace">添加地点</a></@shiro.hasRole>
	          </div>
	        </div>
	      </div>
	    </li>
	    <li class="myhd menu-item">
	      <div class="menu"> <a class="menu-hd" href="#" id="showclaslist">开班表<b></b></a>
	        <div class="mybd">
	          <div class="menu-bd-panel">
	          	<@shiro.hasRole name="admin">
	            <a href="#" id="addclasses">开班</a> 
	            </@shiro.hasRole>
	          </div>
	        </div>
	      </div>
	    </li>
	    <li class="myhd menu-item">
	      <div class="menu"> 
	      	<a class="menu-hd" href="#" id="search" <@shiro.hasRole name="teacher">style="display: none;"</@shiro.hasRole>>搜索</a>
	      </div>
	    </li>
	  </ul>
	</div>
</div>
<div id='calendar'></div>
<div id="arrange" title="安排课程" class="jcourse" style="display: none;">
	<form action="/course/arrange/save.do" method="post" id="savea">
	<table>
		<tr>
			<th>班级：</th>
			<td colspan="4">
				<select name="classesId" id="classesId">
				</select>
			</td>
		</tr>
		<tr>
			<th>地点：</th>
			<td colspan="4">
				<select name="placeId" id="placeid">
					<option value=''>=请选择=</option>
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
		</tr>
		<tr>
			<th>课程：</th>
			<td colspan="4">
				<input type="hidden" id="ccourseId" name="courseId"/>
				<input type="text" id="classcourseid" name="classcourseid" readonly="readonly"/>
				<div id="menuContent" class="menuContent" style="display:none; position: absolute;z-index:2;">
					<ul id="classcoursetree" class="ztree selectztree" style="margin-top:0; width:220px; height: 110px;"></ul>
				</div>
				<input type="hidden" id="number" name="number"/>
			</td>
		</tr>
		<tr>
			<th>教师：</th>
			<td colspan="4">
				<select name="teacherId" id="teacherId"></select>
			</td>
		</tr>
		
		<tr>
			<th>每次课时：</th>
			<td colspan="4">
				<select name="classHour" id="classHour">
					<option value="1" selected="selected">1</option>
					<option value="2">2</option>
					<option value="3">3</option>
					<option value="4">4</option>
				</select>
			</td>
		</tr>
		<tr>
			<th>开始时间：</th>
			<td colspan="4">
				<div id="scutdiv">
					快捷时间:
					<#if tlist??>
					<#list tlist as t>
						<span class="shortcut_span" name="selscut"><a href="#" onclick="selShortcut('${t.startTime?string("HH:mm:ss")}','${t.endTime?string("HH:mm:ss")}')">${t.startTime?string("HH:mm")}-${t.endTime?string("HH:mm")}</a><a href="#" class='del_icon' onclick="delscut('${t.id}',this)"></a></span>
					</#list>
					</#if>
				</div>
				<input type="text" id="startTime" name="startTime" readonly="readonly"/>
			</td>
		</tr>
		<tr>
			<th>结束时间：</th>
			<td colspan="4">
				<input type="text" id="endTime" name="endTime" readonly="readonly"/>
				<a href="javascript:void(0);" id="shortcut" >加为快捷时间</a>
			</td>
		</tr>
		<tr>
			<th title="从今天开始,以本次排课为模板，以后的周一至周日，由您选择哪天安排教授与本次排课相同的课程，系统自动排完该课程所有课时。" rowspan="3">规律排课：</th>
			<th>共排课时：</th>
			<td colspan="3">
				<select name="classHourSum" id="classHourSum">
					
				</select>
			</td>
			
		</tr>
		<tr>
			<td>
				<!-- <input type="hidden" name="arrangeLaw" value=""/> --> 周一<br />
				<#if tlist??>
				<#list tlist as t>
					<input type="checkbox" name="arrangeLaw" value="2-${t.id}"/> ${t.startTime?string("HH:mm")}<br />
				</#list>
				</#if>
				<select name="shortcutplace">
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
			<td>
				 周二<br />
				<#if tlist??>
				<#list tlist as t>
					<input type="checkbox" name="arrangeLaw" value="3-${t.id}"/> ${t.startTime?string("HH:mm")}<br />
				</#list>
				</#if>
				<select name="shortcutplace">
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
			<td>
				 周三<br />
				<#if tlist??>
				<#list tlist as t>
					<input type="checkbox" name="arrangeLaw" value="4-${t.id}"/> ${t.startTime?string("HH:mm")}<br />
				</#list>
				</#if>
				<select name="shortcutplace">
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
			<td>
				 周四<br />
				<#if tlist??>
				<#list tlist as t>
					<input type="checkbox" name="arrangeLaw" value="5-${t.id}"/> ${t.startTime?string("HH:mm")}<br />
				</#list>
				</#if>
				<select name="shortcutplace">
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
		</tr>
		<tr>
			<td>
				 周五<br />
				<#if tlist??>
				<#list tlist as t>
					<input type="checkbox" name="arrangeLaw" value="6-${t.id}"/> ${t.startTime?string("HH:mm")}<br />
				</#list>
				</#if>
				<select name="shortcutplace">
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
			<td>
				 周六<br />
				<#if tlist??>
				<#list tlist as t>
					<input type="checkbox" name="arrangeLaw" value="7-${t.id}"/> ${t.startTime?string("HH:mm")}<br />
				</#list>
				</#if>
				<select name="shortcutplace">
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
			<td colspan="2">
				 周日<br />
				<#if tlist??>
				<#list tlist as t>
					<input type="checkbox" name="arrangeLaw" value="1-${t.id}"/> ${t.startTime?string("HH:mm")}<br />
				</#list>
				</#if>
				<select name="shortcutplace">
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="5" style="text-align: center;">
				<!-- <input type="button" id="copyarr" value="复制" class="ui-button" style="display: none;"/>
				<input type="button" id="cancelcopy" value="取消复制" class="ui-button" style="display: none;"/> -->
				<input type="submit" value="保存" class="ui-button"/>
				<input type="button" id="delarr" value="删除" class="ui-button" style="display: none;"/>
			</td>
		</tr>
	</table>
	<input type="hidden" name="courseNumber" id="courseNumber" value=""/>
	<input type="hidden" name="id" id="arrangeid" />
	</form>
	<div id="selco"></div>
</div>
<div id="addteacher" title="添加教师" style="display: none;">
	<form action="/course/user/save.do" method="post" id="savet">
	<table>
		<tr>
			<th>教师名：</th>
			<td>
				<input type="text" name="name"/>
			</td>
		</tr>
		<tr>
			<th title="统一初始密码为6个8">登录名：</th>
			<td>
				<input type="text" name="loginName" title="统一初始密码为6个8"/>
				<input type="hidden" name="password" value="888888"/>
				<input type="hidden" name="roles" value="teacher"/>
			</td>
		</tr>
		<tr>
			<th>邮箱：</th>
			<td>
				<input type="text" name="mail"/>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="submit" value="保存" class="ui-button"/>
			</td>
		</tr>
	</table>
	</form>
</div>
<div id="accountm" class="jcourse" title="帐号管理" style="display: none;">
	<form action="/course/user/save.do" method="post" id="saveaccount">
		<table>
			<tr>
				<th>教师名：</th>
				<td>
					<input type="text" name="name" id="username"/>
					<input type="hidden" name="roles" id="roles"/>
				</td>
			</tr>
			<tr>
				<th>登录名：</th>
				<td>
					<input type="text" name="loginName" id="userln"/>
				</td>
			</tr>
			<tr>
				<th>邮箱：</th>
				<td>
					<input type="text" name="mail" id="email"/>
				</td>
			</tr>
			<tr id="upptr">
				<td colspan="2" style="text-align: center;">
					<a href="javascript:void(0);" id="uppass">修改密码</a>
				</td>
			</tr>
			
			<tr id="sutr">
				<td colspan="2" style="text-align: center;">
					<input type="hidden" name="id" id="userid" value="${(user.id)!}"/>
					<input type="submit" value="保存" class="ui-button"/>
				</td>
			</tr>
		</table>
	</form>
</div>
<div id="teacherlist" class="jcourse" title="教师列表" style="display: none;">
	<table id="tlt">
		
	</table>
</div>
<div id="kclist" title="课程列表" style="display: none;">
	<div style="text-align: left;">
		&nbsp;&nbsp;&nbsp;<span class='button add' id='tjkctree' title='添加课程'></span>
	</div>
	<div>
		<ul id="coursetree" class="ztree"></ul>
	</div>
</div>
<div id="tjkc" title="添加课程" style="display: none;">
	<form action="/course/category/save.do" method="post" id="savecourse">
	<table>
		<tr>
			<th>课程名：</th>
			<td>
				<input type="text" name="name"/>
			</td>
		</tr>
		<tr>
			<th>课时：</th>
			<td>
				<input type="text" name="classHour"/>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="submit" value="保存"/>
			</td>
		</tr>
		<input type="hidden" name="type" value="1"/>
		<input type="hidden" name="categoryId" id="categoryId" value=""/>
	</table>
	</form>
</div>
<div id="tjdd" title="添加地点" style="display: none;">
	<form action="/course/category/save.do" method="post" id="saveplace">
	<table>
		<tr>
			<th>地点：</th>
			<td>
				<input type="text" name="name"/>
			</td>
		</tr>
		<tr>
			<th>区分颜色：</th>
			<td>
				<select name="color">
					<option value="#DC2127">红色</option>
					<option value="#384DD8">蓝色</option>
					<option value="#DBADFF">紫色</option>
					<option value="#494949">黑色</option>
				</select>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<input type="submit" value="保存"/>
			</td>
		</tr>
		<input type="hidden" name="type" value="6"/>
	</table>
	</form>
</div>
<div id="placelist" class="jcourse" title="授课地点列表" style="display: none;">
	<table id="plt"></table>
</div>
<div id="classlist" class="jcourse" title="授课地点列表" style="display: none;">
	<table id="claslt"></table>
</div>
<div id="kb" class="jcourse" title="开班" style="display: none;">
	<form action="/course/classes/save.do" method="post" id="saveclass">
	<table>
		<tr>
			<th>是否VIP</th>
			<td>
				<input type="radio" name="isVIP" checked="checked" value="0"/>否
				<input type="radio" name="isVIP" value="1"/>是
			</td>
		</tr>
		<tr>
			<th>课程：</th>
			<td>
				<select id="course" name="courseId"></select>
			</td>
		</tr>
		<tr>
			<th>地点：</th>
			<td>
				<select id="place" name="placeId"></select>
			</td>
		</tr>
		<tr>
			<th><span id="bjmc">班级</span>名称：</th>
			<td>
				<input type="text" name="className" id="className"/>
			</td>
		</tr>
		
		<tr>
			<th>备注：</th>
			<td>
				<input type="text" name="remark"/>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="text-align: center;">
				<input type="submit" value="保存" class="ui-button"/>
			</td>
		</tr>
		<input type="hidden" name="type" value="1"/>
	</table>
	</form>
</div>
<div id="searchdialog" title="搜索" style="display: none;">
	<table>
		<tr>
			<td>
				教师：
			</td>
			<td>
				<select id="seartea"></select>
			</td>
		</tr>
		<tr>
			<td>
				地点：
			</td>
			<td>
				<select id="seapla">
					<option value=''>=请选择=</option>
					<#if plist??>
					<#list plist as p>
						<option value='${p.id}'>${p.name!}</option>
					</#list>
					</#if>
				</select>
			</td>
		</tr>
		<tr>
			<td>日期：</td>
			<td>
				<input type="text" style="width: 90px;" id="seadates"/> 到 <input type="text" style="width: 90px;" id="seadatee"/>
			</td>
		</tr>
	</table>
</div>
<div id="seares" title="搜索结果" class="jcourse" style="display: none;">
	<table id="searchresult">
		
	</table>
</div>

</body>
<script type="text/javascript" src="../static/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../static/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../static/jquery/jquery.form.js"></script>
<script type="text/javascript" src="../static/fullcalendar/fullcalendar.max.js"></script>
<script type="text/javascript" src="../static/jquery-ui-time/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="../static/navigate/js/navigate.js"></script>
<script type="text/javascript" src="../static/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="../static/ztree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript" src="../static/ztree/js/jquery.ztree.exedit.js"></script>
<script type="text/javascript" src="../static/myjs/addcourse.js"></script>
<script type="text/javascript" src="../static/myjs/datepickerCN.js"></script>
<script type="text/javascript" src="../static/jquery-validation/jquery.validate.js"></script>
<script type="text/javascript" src="../static/jquery-validation/messages_zh.js"></script>
<script type="text/javascript" src="../static/myjs/arrange/hashMap.js"></script>
<script type="text/javascript">
var seldate;
var iscopyarr=false;
var updevent;

var classAndPlace = new HashMap();
<#if clist??><#list clist as c>
classAndPlace.put("${c.id}","${c.placeId}");
</#list></#if>


var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var fullCalendarOptions = {
		theme: true,
		header: {
			left: 'prev,next today',
			center: 'title',
			right: 'month,agendaWeek,agendaDay'
		},
		editable: true,
		
		dayClick: function(date, allDay, jsEvent, view){
			seldate = $.fullCalendar.formatDate(date, "yyyy-MM-dd");
			<@shiro.hasRole name="admin">
			$( "#arrange" ).dialog({ title: "安排课程 "+ seldate});
			$("#classcourseid").val("");
			//正常添加
			if(!iscopyarr){
				//选班级
				$.get("/course/classes/getclaslist.do",function(data){
					if(data!=""){
						var a = $("#classesId");
						a.empty();
						a.append("<option value=''>=请选择=</option>");
						//var selco = $("#selco")
						//selco.empty();
						for ( var i = 0; i < data.length; i++) {
							a.append("<option value='"+data[i].id+"'>"+data[i].className+"</option>");
							//selco.append("<input type='hidden' id='"+data[i].place.id+"' value='"+data[i].place.color+"'/>");
						}
					}
				},"json");
				//选教师
				$.get("/course/user/getarrter.do",{date:seldate, _:(new Date()).getTime() },function(data){
					if(data!=""){
						var a = $("#teacherId");
						a.empty();
						for ( var i = 0; i < data.length; i++) {
							a.append("<option value='"+data[i][0]+"'>"+data[i][1]+",已排:"+data[i][2]+"</option>");
						}
					}
				},"json");
				
				$("#arrangeid").val("");
				$("#copyarr").hide();
				$("#delarr").hide();
				$( "#arrange" ).dialog( "open" );
			}
			else{//复制
				var sti = $("#startTime");
				var eti = $("#endTime");
				if(sti.val().indexOf(" ")>-1){
					var stem = sti.val().split(" ");
					sti.val(stem[1]);
					var etem = eti.val().split(" ");
					eti.val(etem[1]);
				}
				
				$.get("/course/arrange/getcoursenum.do",{classesId:$("#classesId").val(),courseId:$("#ccourseId").val(),_:(new Date()).getTime() },function(data){
					$("#number").val(data);
					$("#arrangeid").val("");
				    $("#savea").ajaxSubmit(saoptions);
				},"json");
			}
			</@shiro.hasRole>
			return false;
		},
		eventClick: function(calEvent, jsEvent, view) {
			<@shiro.hasRole name="admin">
			seldate = $.fullCalendar.formatDate(new Date(calEvent.start), "yyyy-MM-dd");
			($("#savea").validate()).resetForm();
			updevent = calEvent;
			$("#copyarr").show();
			$("#delarr").show();
			$.get("/course/arrange/goupdate.do",{id:calEvent.id},function(arr){
				//地点
				$("#placeid").val( arr.placeId );
				//选班级
				$.get("/course/classes/getclaslist.do",function(data){
					if(data!=""){
						var a = $("#classesId");
						a.empty();
						a.append("<option value=''>=请选择=</option>");
						//var selco = $("#selco")
						//selco.empty();
						for ( var i = 0; i < data.length; i++) {
							a.append("<option value='"+data[i].id+"'>"+data[i].className+"</option>");
							//selco.append("<input type='hidden' id='"+data[i].place.id+"' value='"+data[i].place.color+"'/>");
						}
						a.val( arr.classesId );
						
						classcousersetting.async.otherParam.classId= arr.classesId;
						$.fn.zTree.init($("#classcoursetree"), classcousersetting);
						
						//教师
						$.get("/course/user/getarrter.do",{date:$.fullCalendar.formatDate(new Date(arr.startTime ), "yyyy-MM-dd"), _:(new Date()).getTime()},function(data){
							if(data!=""){
								var a = $("#teacherId");
								a.empty();
								for ( var i = 0; i < data.length; i++) {
									a.append("<option value='"+data[i][0]+"'>"+data[i][1]+",已排:"+data[i][2]+"</option>");
								}
								a.val(arr.teacherId);
							}
						},"json");
						
						$("#classcourseid").val( arr.course.name+"(总课时:"+arr.course.classHour+")" );
						$("#courseId").val( arr.course.id );
					}
				},"json");
				
				$("#startTime").val( $.fullCalendar.formatDate(new Date(arr.startTime), "yyyy-MM-dd hh:mm:ss") );
				$("#endTime").val( $.fullCalendar.formatDate(new Date(arr.endTime), "yyyy-MM-dd hh:mm:ss") );
				$("#arrangeid").val( calEvent.id );
				$("#number").val(arr.number);
				$("#ccourseId").val(arr.courseId);
				
				$( "#arrange" ).dialog( "open" );
			},"json");
			</@shiro.hasRole>
		},
		eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {
			<@shiro.hasRole name="admin">
	        $.post("/course/arrange/arrangedrop.do",{id:event.id, days:dayDelta, minutes:minuteDelta},function(data){
	        	if(data==null || data=="" ) revertFunc();
	        },"json");
	        </@shiro.hasRole>
	    },
	  	eventRender: function(event, element) {
		  	element.attr('title', event.tooltip);
	        element.tooltip({
	    		position: {
			        my: "left top",
			        at: "left bottom"
			      }
			});
	    }

	};
	
$(function() {
	
	//初始课程安排
	role = '${(user.id)!}';
	<@shiro.hasRole name="admin">
	role = 'no';
	</@shiro.hasRole>
	fullCalendarOptions.events = '/course/arrange/getarrange.do?uid='+role;
	$('#calendar').fullCalendar( fullCalendarOptions );
	
	
	
	$("#startTime").timepicker({timeFormat: 'HH:mm:ss', hourMin: 8, hourMax: 23, hourGrid: 3, minuteGrid: 30}); 
	$("#endTime").timepicker({timeFormat:'HH:mm:ss', hourMin: 8, hourMax: 23, hourGrid: 3, minuteGrid: 30});
	
	
	//搜索日期框
	$("#seadates").datepicker( $.datepicker.regional[ "zh-CN" ] );
	$("#seadatee").datepicker( $.datepicker.regional[ "zh-CN" ] );
	
	/* $("#savet").ajaxForm({
		dataType : "json",
		success : function(data){
			if(data){
				alert("保存教师成功！");
				$("#addteacher").dialog("close");
				$('#savet').clearForm();
			}
		}
	}); */
	
	
	
	$.fn.zTree.init($("#coursetree"), setting);
});

function getTeachers(str){
	$.get("/course/user/getterlist.do",function(data){
		if(str=="searchTeacher"){
			if(data!=""){
				var a = $("#seartea");
				a.empty();
				a.append("<option value=''>=请选择=</option>");
				for ( var i = 0; i < data.length; i++) {
					a.append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
				}
			}
		}
		else if (str=="teacherList") {
			$.get("/course/user/getterlist.do",function(data){
				if(data!=""){
					var a = $("#tlt");
					a.empty();
					a.append("<tr><th>教师名称</th><th>操作</th></tr>");
					for ( var i = 0; i < data.length; i++) {
						a.append("<tr><td><a href='#' onclick=\"sortbyteach('"+data[i].id+"')\">"+data[i].name+"</a></td><td></td></tr>");
					}
				}
			},"json");
		}
	},"json");
}

function getTeachPlace(str){
	$.get("/course/category/getcategories.do",{type:6},function(data){
		if(data!=""){
			if(str=="placeList"){
				var a = $("#plt");
				a.empty();
				a.append("<tr><th>授课地点</th><th>区分颜色</th><th>操作</th></tr>");
				for ( var i = 0; i < data.length; i++) {
					a.append("<tr><td>"+data[i].name+"</td><td><span style='height:9px;background:"+data[i].color+";'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td><td></td></tr>");
				}
			}
			else if (str=="searchPlace") {
				/* var a = $("#seapla");
				a.empty();
				a.append("<option value=''>=请选择=</option>");
				for ( var i = 0; i < data.length; i++) {
					a.append("<option value='"+data[i].id+"'>"+data[i].name+"</option>");
				} */
			}
		}
	},"json");
}

function sortbyteach(uid){
	$('#calendar').fullCalendar( 'destroy' );
	fullCalendarOptions.events = '/course/arrange/getarrange.do?uid='+uid;
	$('#calendar').fullCalendar( fullCalendarOptions );
}

function delscut(id,obj){
	if( confirm("确定要删除吗？") ){
		$.get("/course/category/delcategory.do",{id:id},function(data){
			if(data){
				alert("删除成功！");
				$(obj).parent().remove();
			}
		},"json");
	}
}

function selShortcut(st,et){
	$("#startTime").val(st);
	$("#endTime").val(et);
}
</script>
<script type="text/javascript" src="../static/myjs/arrange/jqdialog.js"></script>
<script type="text/javascript" src="../static/myjs/arrange/jqclick.js"></script>
<script type="text/javascript" src="../static/myjs/arrange/jqsave.js"></script>
</html>